﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GamePlusClassLibrary;

namespace GamePlus.UserControls
{
    public partial class mod_updates : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
                loadContent();
        }

        private void loadContent()
        {
            //string sContent = "<ul>";

            //List<whats_news> ls = whats_news.ListLastByTop(20);
            //ls.ForEach(delegate(whats_news obj) {

            //    game_temps objGame = null;
            //    users objUser = users.Load(obj._user_ID);

            //    ///images/users/000/006/638/thumb_6638.jpg?1263058672
            //    ////images/default/avatars/000/000/022/thumb_22.jpg?1294921456 

            //    string sLi = "<li class=\"bdc1\">";
            //    sLi += "<a href=\"/user-profile/"+ obj._ID.ToString() +"\"><img src=\"/images/tmp/avatar.jpg\" /></a>" + 
            //        "<span class=\"txt\"><a href=\"/user-profile/"+ obj._ID.ToString() +"\" class=\"link1\">"+ objUser._username +"</a>";

            //    switch (obj._updatable_Type)
            //    { 
            //        case "GamesUser":
            //            objGame = game_temps.Load(obj._updatable_ID);
            //            sLi += " adicionou o jogo <a href=\"/game\" class=\"link1\">"+ objGame._name +"</a> à sua lista de favoritos</span></li>";
            //            break;
            //        case "Invite":
            //            sLi += " fez um convite!</li>";
            //            break;
            //        case "Message":
            //            sLi += " enviou uma mensagem!</li>";
            //            break;
            //        case "Score":
            //            scores objScores = scores.Load(obj._updatable_ID);
            //            objGame = game_temps.Load(objScores._game_ID);
            //            sLi += " fez "+ objScores._numeric +" pontos em <a href=\"/game\" class=\"link1\">"+ objGame._name +"</a></span></li>";
            //            break;
            //        case "StatusMessage":
            //            sLi += " mudou sua mensagem de status!</li>";
            //            break;
            //        default: //Cadastro novo
            //            sLi += " fez cadastro no Gameplus!</span></li>";
            //            break;
            //    }

            //    sContent += sLi;
            //});

            //sContent += "</ul>";
            //divContent.InnerHtml = string.Empty;
            //divContent.InnerHtml = sContent;
        }


    }
}